/**
 * Created by LangK on 2016/12/20.
 */
import Vue from 'vue'

const beginLoading = commit => {
  console.log(commit+" start")
  return Date.now()
}


const stopLoading = commit => {
  console.log(commit+" stop")
  return Date.now()
}


export default {
// 登录
login({commit},postdata){
      console.log(postdata)
    beginLoading('login--');
    return Vue.http.post('/admin/system/user/V0_0_1/login',postdata).then(response => {
      stopLoading('login--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取用户列表
getUserInfoList({commit},postdata){
      console.log(postdata)
    beginLoading('getUserInfoList--');
    return Vue.http.post('/admin/double/user/V0_0_1/getlist',postdata).then(response => {
      stopLoading('getUserInfoList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 广告主页面数据
getadOwerList({commit}, postdata) {
    console.log(postdata)
    beginLoading('getadOwerList--');
    return Vue.http.post('/adsys/advertiser/V0_0_1/findPage', postdata).then(response => {
      stopLoading('getadOwerList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
 // 广告主页面添加广告主
adaddOwerlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('adaddOwerlist--');
    return Vue.http.post('/adsys/advertiser/V0_0_1/save', postdata).then(response => {
      stopLoading('adaddOwerlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告主页面数据、广告主页面搜索
getadOrdinaryList({commit}, postdata) {
    console.log(postdata)
    beginLoading('getadOrdinaryList--');
    return Vue.http.post('/adsys/advertisement/V0_0_1/findPage', postdata).then(response => {
      stopLoading('getadOrdinaryList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告页面暂停
stopreleaselist({commit}, postdata) {
    console.log(postdata)
    beginLoading('stopreleaselist--');
    var url = '/adsys/advertisement/V0_0_1/updateStatusById/' + postdata.id +'/2'
    console.log(url)
    return Vue.http.get(url).then(response => {
      stopLoading('stopreleaselist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告页面发布
statreleaselist({commit}, postdata) {
    console.log(postdata)
    beginLoading('statreleaselist--');
    var url = '/adsys/advertisement/V0_0_1/updateStatusById/' + postdata.id +'/1'
    console.log(url)
    return Vue.http.get(url).then(response => {
      stopLoading('statreleaselist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告页面 编辑
edixindfnlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('edixindfnlist--');
    var url = '/adsys/advertisement/V0_0_1/getAdvById/' + postdata.id
    console.log(url)
    return Vue.http.get(url).then(response => {
      stopLoading('edixindfnlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告页面 编辑下的 更新（保存）
edixbtnlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('edixbtnlist--');
    return Vue.http.post('/adsys/advertisement/V0_0_1/update',postdata).then(response => {
      stopLoading('edixbtnlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 普通广告页面 添加功能
adaddlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('adaddlist--');
    return Vue.http.post('/adsys/advertisement/V0_0_1/save',postdata).then(response => {
      stopLoading('adaddlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
 // 普通广告页面删除
adOrdDellist({commit}, postdata) {
    console.log(postdata)
    beginLoading('adOrdDellist--');
    var url = '/adsys/advertisement/V0_0_1/delete/' + postdata.id
    return Vue.http.get(url).then(response => {
      stopLoading('adOrdDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 广告主页面删除
adOwerDellist({commit}, postdata) {
    console.log(postdata)
    beginLoading('adOwerDellist--');
    var url = '/adsys/advertiser/V0_0_1/delete/' + postdata.id
    return Vue.http.get(url).then(response => {
      stopLoading('adOwerDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取红包管理页面列表
gethbmanagelist({commit},postdata){
      console.log(postdata)
    beginLoading('gethbmanagelist--');
    return Vue.http.post('/admin/double/redpaket/V0_0_1/list',postdata).then(response => {
      stopLoading('gethbmanagelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 红包管理页面删除
hbmanageDellist({commit}, postdata) {
    console.log(postdata)
    beginLoading('hbmanageDellist--');
    var url = '/admin/double/redpaket/V0_0_1/delete/' + postdata.id + "?token="+postdata.token
    return Vue.http.get(url).then(response => {
      stopLoading('hbmanageDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 红包管理页面详情数据
hbdetaillist({commit},postdata){
      console.log(postdata)
    beginLoading('hbdetaillist--');
    return Vue.http.post('/admin/double/redpaket/V0_0_1/getRedpaketById',postdata).then(response => {
      stopLoading('hbdetaillist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 红包管理页面添加红包
hbedixbtnlist({commit},postdata){
      console.log(postdata)
    beginLoading('hbedixbtnlist--');
    return Vue.http.post('/admin/double/redpaket/V0_0_1/save',postdata).then(response => {
      stopLoading('hbedixbtnlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取兑换码页面列表
excodelist({commit},postdata){
      console.log(postdata)
    beginLoading('excodelist--');
    return Vue.http.post('/admin/double/redeemcode/V0_0_1/getlist',postdata).then(response => {
      stopLoading('excodelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 兑换码页面删除
excodeDellist({commit}, postdata) {
    console.log(postdata)
    beginLoading('excodeDellist--');
    var url = '/admin/double/redeemcode/V0_0_1/delRedeemCode/' + postdata.id
    return Vue.http.get(url).then(response => {
      stopLoading('excodeDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 兑换码页面添加兑换码
codeedixbtnlist({commit},postdata){
      console.log(postdata)
    beginLoading('codeedixbtnlist--');
    return Vue.http.post('/admin/double/redeemcode/V0_0_1/save',postdata).then(response => {
      stopLoading('codeedixbtnlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
 // 兑换码页面 编辑下的 更新（保存）
editsavelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('editsavelist--');
    return Vue.http.post('/admin/double/redeemcode/V0_0_1/updateRedeemCode',postdata).then(response => {
      stopLoading('editsavelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
//  获取用户账单
getUserCount({commit},postdata){
      console.log(postdata)
    beginLoading('getUserCount--');
    return Vue.http.post('/admin/double/pay/V0_0_1/getHalfYearDetail',postdata).then(response => {
      stopLoading('getUserCount--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 根据上次登录时间检索用户列表
getUserListByLoginTime({commit},postdata){
      console.log(postdata)
    beginLoading('getUserListByLoginTime--');
    return Vue.http.post('/admin/double/user/V0_0_1/getlistByUserLogin',postdata).then(response => {
      stopLoading('getUserListByLoginTime--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
 // 根据邀请人数检索用户列表
getUserListByInvite({commit},postdata){
      console.log(postdata)
    beginLoading('getUserListByInvite--');
    return Vue.http.post('/admin/double/user/V0_0_1/getlistByInvited',postdata).then(response => {
      stopLoading('getUserListByInvite--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 封禁与解禁用户
setUserDisableOrEnable({commit},postdata){
      console.log(postdata)
    beginLoading('setUserDisableOrEnable--');
    return Vue.http.post('/admin/user/V0_0_1/disableOrEnable',postdata).then(response => {
      stopLoading('setUserDisableOrEnable--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取系统奖励列表
getReward({commit},postdata){
      console.log(postdata)
    beginLoading('getReward--');
    return Vue.http.post('/admin/double/dictionary/V0_0_1/getRewards').then(response => {
      stopLoading('getReward--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 新建系统奖励
setNewReward({commit},postdata){
      console.log(postdata)
    beginLoading('setNewReward--');
    return Vue.http.post('/admin/double/dictionary/V0_0_1/addDictionary',postdata).then(response => {
      stopLoading('setNewReward--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 编辑奖励
editReward({commit},postdata){
      console.log(postdata)
    beginLoading('editReward--');
    return Vue.http.post('/admin/double/dictionary/V0_0_1/updateDictionary',postdata).then(response => {
      stopLoading('editReward--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除奖励
deleteReward({commit},postdata){
      console.log(postdata)
    beginLoading('deleteReward--');
    return Vue.http.get('/admin/double/dictionary/V0_0_1/delDictionary/'+postdata).then(response => {
      stopLoading('deleteReward--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取全部系统消息
getSystemMsg({commit},postdata){
      console.log(postdata)
    beginLoading('getSystemMsg--');
    return Vue.http.post('/admin/double/message/V0_0_1/selectAll',postdata).then(response => {
      stopLoading('getSystemMsg--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除系统消息
deletSystemMsg({commit},postdata){
      console.log(postdata)
    beginLoading('deletSystemMsg--');
    return Vue.http.get('/admin/double/message/V0_0_1/deleteMessage/'+postdata).then(response => {
      stopLoading('deletSystemMsg--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取提现规则
getCashRule({commit},postdata){
      console.log(postdata)
    beginLoading('getCashRule--');
    return Vue.http.post('/admin/double/dictionary/V0_0_1/getRewards',postdata).then(response => {
      stopLoading('getCashRule--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 修改提现规则
updateCashRule({commit},postdata){
      console.log(postdata)
    beginLoading('updateCashRule--');
    return Vue.http.post('/admin/double/dictionary/V0_0_1/updatePay',postdata).then(response => {
      stopLoading('updateCashRule--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取审核列表
getVerifyList({commit},postdata){
      console.log(postdata)
    beginLoading('updateCashRule--');
    return Vue.http.post('/admin/double/pay/V0_0_1/getWithdrawList',postdata).then(response => {
      stopLoading('updateCashRule--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 获取首页配置列表
getIndexSetList({commit},postdata){
      console.log(postdata)
    beginLoading('getIndexSetList--');
    return Vue.http.post('/admin/double/avi/V0_0_1/selectLkEffect',postdata).then(response => {
      stopLoading('getIndexSetList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 修改首页配置列表
updateIndexSetList({commit},postdata){
      console.log(postdata)
    beginLoading('updateIndexSetList--');
    return Vue.http.post('/admin/double/avi/V0_0_1/updateLkEffect',postdata).then(response => {
      stopLoading('updateIndexSetList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
 // 添加首页配置列表
addIndexSet({commit}, postdata) {
    console.log(postdata)
    beginLoading('addIndexSet--');
   return Vue.http.post('/admin/double/avi/V0_0_1/saveLkEffect',postdata).then(response => {
      stopLoading('addIndexSet--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },   
 // 删除首页配置列表
deleteIndexSet({commit}, postdata) {
    console.log(postdata)
    beginLoading('deleteIndexSet--');
   return Vue.http.get('/admin/double/avi/V0_0_1/deleteLkEffect/'+postdata).then(response => {
      stopLoading('deleteIndexSet--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },   
// 获取用户信息
getUserInfoById({commit},postdata){
      console.log(postdata)
    beginLoading('getUserInfoById--');
    return Vue.http.get('/admin/double/pay/V0_0_1/getProposerInfo/'+postdata.userId+'?token='+postdata.token).then(response => {
      stopLoading('getUserInfoById--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取应用数据管理列表
getDataManageList({commit},postdata){
      console.log(postdata)
    beginLoading('getDataManageList--');
    return Vue.http.post('/admin/system/app/V0_0_1/selectDict',postdata).then(response => {
      stopLoading('getDataManageList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 新建应用数据
setNewData({commit},postdata){
      console.log(postdata)
    beginLoading('setNewData--');
    return Vue.http.post('/admin/system/app/V0_0_1/addDict',postdata).then(response => {
      stopLoading('setNewData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除应用数据
deleteDataManage({commit},postdata){
      console.log(postdata)
    beginLoading('deleteDataManage--');
    return Vue.http.get('/admin/system/app/V0_0_1/delDict/'+postdata.id+'?token='+postdata.token).then(response => {
      stopLoading('deleteDataManage--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取推广渠道列表
getChannelList({commit},postdata){
      console.log(postdata)
    beginLoading('getChannelList--');
    return Vue.http.post('/admin/double/operator/V0_0_1/findOperatorPage',postdata).then(response => {
      stopLoading('getChannelList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 添加推广渠道
addChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('addChannelData--');
    return Vue.http.post('/admin/double/operator/V0_0_1/saveOperator',postdata).then(response => {
      stopLoading('addChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 修改推广渠道
editChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('editChannelData--');
    return Vue.http.post('/admin/double/operator/V0_0_1/updateOperator',postdata).then(response => {
      stopLoading('editChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除推广渠道
deleteChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('deleteChannelData--');
    return Vue.http.get('/admin/double/operator/V0_0_1/deleteOperator/'+postdata).then(response => {
      stopLoading('deleteChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 检索推广渠道
checkChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('checkChannelData--');
    return Vue.http.post('/admin/double/operator/V0_0_1/selectStatistic',postdata).then(response => {
      stopLoading('checkChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取反馈信息列表
getFeedBackList({commit},postdata){
      console.log(postdata)
    beginLoading('getFeedBackList--');
    return Vue.http.post('/admin/double/back/V0_0_1/findfeedPage',postdata).then(response => {
      stopLoading('getFeedBackList--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
},
// 获取用户被投诉列表
complainlist({commit},postdata){
      console.log(postdata)
    beginLoading('complainlist--');
    return Vue.http.post('/admin/complaint/V0_0_1/selectComUser',postdata).then(response => {
      stopLoading('complainlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 回复反馈信息
replyFeedBack({commit},postdata){
      console.log(postdata)
    beginLoading('replyFeedBack--');
    return Vue.http.post('/admin/double/back/V0_0_1/toReplyBack',postdata).then(response => {
      stopLoading('replyFeedBack--')
     if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
},
// 用户被投诉列表 封停
gropcomplainlist({commit},postdata){
      console.log(postdata)
    beginLoading('gropcomplainlist--');
    return Vue.http.post('/admin/complaint/V0_0_1/selectComGroup',postdata).then(response => {
      stopLoading('gropcomplainlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取反馈消息详情
getDetialFeedBackMsg({commit},postdata){
      console.log(postdata)
    beginLoading('getDetialFeedBackMsg--');
    return Vue.http.get('/admin/double/back/V0_0_1/getReplyBack/'+postdata.backId+'?token='+postdata.token).then(response => {
      stopLoading('getDetialFeedBackMsg--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
},
// 获取群投诉管理列表
stop({commit},postdata){
      console.log(postdata)
    beginLoading('stop--');
    return Vue.http.post('/admin/user/V0_0_1/disableOrEnable',postdata).then(response => {
      stopLoading('stop--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },   
// 获取文案列表
getDocumentList({commit},postdata){
      console.log(postdata)
    beginLoading('getDocumentList--');
    return Vue.http.post('/admin/double/text/V0_0_1/selectAllList',postdata).then(response => {
      stopLoading('getDocumentList--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 新建文案
addDocument({commit},postdata){
      console.log(postdata)
    beginLoading('addDocument--');
    return Vue.http.post('/admin/double/text/V0_0_1/createText',postdata).then(response => {
      stopLoading('addDocument--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 编辑文案
updateDocument({commit},postdata){
      console.log(postdata)
    beginLoading('updateDocument--');
    return Vue.http.post('/admin/double/text/V0_0_1/updateText',postdata).then(response => {
      stopLoading('updateDocument--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除文案
deleteDocument({commit},postdata){
      console.log(postdata)
    beginLoading('updateDocument--');
    return Vue.http.post('/admin/double/text/V0_0_1/deleteText',postdata).then(response => {
      stopLoading('updateDocument--')
        if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 解散群投诉管理
jiesanlist({commit},postdata){
      console.log(postdata)
    beginLoading('jiesanlist--');
    return Vue.http.post('/admin/complaint/V0_0_1/deleteGroup',postdata).then(response => {
      stopLoading('jiesanlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 群投诉管理详情
gropdetaillist({commit},postdata){
      console.log(postdata)
    beginLoading('gropdetaillist--');
    return Vue.http.post('/admin/complaint/V0_0_1/selectComGroupUser',postdata).then(response => {
      stopLoading('gropdetaillist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 用户等级管理详情
levelManagelist({commit},postdata){
      console.log(postdata)
    beginLoading('levelManagelist--');
    return Vue.http.get('/admin/double/experience/V0_0_1/selectAll',postdata).then(response => {
      stopLoading('levelManagelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 添加用户等级
addlevellist({commit},postdata){
      console.log(postdata)
    beginLoading('addlevellist--');
    return Vue.http.post('/admin/double/experience/V0_0_1/addExperLevel',postdata).then(response => {
      stopLoading('addlevellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 修改用户等级
leveleditlist({commit},postdata){
      console.log(postdata)
    beginLoading('leveleditlist--');
    return Vue.http.post('/admin/double/experience/V0_0_1/updateExperLevel',postdata).then(response => {
      stopLoading('leveleditlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },  
// 删除用户等级
levelDellist({commit},postdata){
      console.log(postdata)
    beginLoading('levelDellist--');
    var url = '/admin/double/experience/V0_0_1/deleteExperLevel/' + postdata.id
    return Vue.http.get(url,postdata).then(response => {
      stopLoading('levelDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 修改推广渠道
editChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('editChannelData--');
    return Vue.http.post('/admin/double/operator/V0_0_1/updateOperator',postdata).then(response => {
      stopLoading('editChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 删除推广渠道
deleteChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('deleteChannelData--');
    return Vue.http.get('/admin/double/operator/V0_0_1/deleteOperator/'+postdata).then(response => {
      stopLoading('deleteChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 检索推广渠道
checkChannelData({commit},postdata){
      console.log(postdata)
    beginLoading('checkChannelData--');
    return Vue.http.post('/admin/double/operator/V0_0_1/selectStatistic',postdata).then(response => {
      stopLoading('checkChannelData--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 审核操作
doVerifyRequest({commit},postdata){
      console.log(postdata)
    beginLoading('passVerifyRequest--');
    return Vue.http.post('/admin/double/pay/V0_0_1/updateWithdrawState',postdata).then(response => {
      stopLoading('passVerifyRequest--')
            if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
},
// 普通广告动态获取兴趣
getIntrestlist({commit},postdata){
      console.log(postdata)
    beginLoading('getIntrestlist--');
    return Vue.http.post('/admin/system/app/V0_0_1/selectDict',postdata).then(response => {
      stopLoading('getIntrestlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 上传文件  
uploadFile({commit},postdata){
      console.log(postdata)
    beginLoading('uploadFile--');
    return Vue.http.post('/fileUploadApi/V1.0.0/api/file/upload',postdata).then(response => {
      stopLoading('uploadFile--')
     if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取select下拉框下的广告主
getadselectlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('getadselectlist--');
    return Vue.http.post('/adsys/advertiser/V0_0_1/findPage', postdata).then(response => {
      stopLoading('getadselectlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 添加系统消息
addSystemMessage({commit},postdata){
      console.log(postdata)
    beginLoading('addSystemMessage--');
    return Vue.http.post('/admin/double/message/V0_0_1/addMessage',postdata).then(response => {
      stopLoading('addSystemMessage--')
     if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 首页面获取用户总数量数据
userCountlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('userCountlist--');
    return Vue.http.get('/admin/statistics/V0_0_1/getUserCountsPicture', postdata).then(response => {
      stopLoading('userCountlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 发送系统消息
sendSystemMessage({commit},postdata){
      console.log(postdata)
    beginLoading('sendSystemMessage--');
    return Vue.http.post('/admin/double/message/V0_0_1/sendMessage',postdata).then(response => {
      stopLoading('sendSystemMessage--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 首页面获取活跃用户数据
 useractivelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('useractivelist--');
    return Vue.http.get('/admin/double/statistics/V0_0_1/getDayActiveUserCount', postdata).then(response => {
      stopLoading('useractivelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 首页面获取性别数据
usersexlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('usersexlist--');
    return Vue.http.get('/admin/statistics/V0_0_1/selectSexGroup', postdata).then(response => {
      stopLoading('usersexlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 首页面获取省份数据
provicelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('provicelist--');
    return Vue.http.get('/admin/statistics/V0_0_1/selectProvinceGroup', postdata).then(response => {
      stopLoading('provicelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 首页面获取年龄数据
useragelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('useragelist--');
    return Vue.http.get('/admin/statistics/V0_0_1/selectAgeGroup', postdata).then(response => {
      stopLoading('useragelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取商户认证信息列表
getSellerList({commit}, postdata) {
    console.log(postdata)
    beginLoading('getSellerList--');
   return Vue.http.post('/merchantRemote/V1.0.0/merchant/getMerchantAuthenticatePage',postdata).then(response => {
      stopLoading('getSellerList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 获取商户详细认证信息
getSellerInfo({commit}, postdata) {
    console.log(postdata)
    beginLoading('getSellerInfo--');
   return Vue.http.post('/merchantRemote/V1.0.0/merchant/getMerchantAuthenticateById',postdata).then(response => {
      stopLoading('getSellerInfo--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
// 审核商户认证信息
verifySeller({commit}, postdata) {
    console.log(postdata)
    beginLoading('verifySeller--');
   return Vue.http.post('/merchantRemote/V1.0.0/merchant/reviewMerchantAuthenticate',postdata).then(response => {
      stopLoading('verifySeller--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  }, 
// 删除商户认证信息
deleteSeller({commit}, postdata) {
    console.log(postdata)
    beginLoading('deleteSeller--');
   return Vue.http.post('/merchantRemote/V1.0.0/merchant/deleteMerchantAuthenticateById',postdata).then(response => {
      stopLoading('deleteSeller--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },   
// 获取邀请信息
getInviteInfo({commit}, postdata) {
    console.log(postdata)
    beginLoading('getInviteInfo--');
   return Vue.http.post('/admin/double/user/V0_0_1/getInvitedlistByParentId',postdata).then(response => {
      stopLoading('getInviteInfo--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },    
  // 获取广告队列
  adqueuelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('adqueuelist--');
    return Vue.http.get('/adsys/advertisement/V0_0_1/findByAdvLocation', postdata).then(response => {
      stopLoading('adqueuelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
   // 获取协作账号页面数据
  cooperManagelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('cooperManagelist--');
    return Vue.http.post('/admin/system/user/V0_0_1/list', postdata).then(response => {
      stopLoading('cooperManagelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 获取账号角色数据
  rolManagelist({commit}, postdata) {
    console.log(postdata)
    beginLoading('rolManagelist--');
    return Vue.http.post('/admin/system/role/V0_0_1/list', postdata).then(response => {
      stopLoading('rolManagelist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 删除账号数据
  cooperDellist({commit}, postdata) {
    console.log(postdata)
    beginLoading('cooperDellist--');
    return Vue.http.post('/admin/system/user/V0_0_1/deleteUser', postdata).then(response => {
      stopLoading('cooperDellist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 添加协作账号
  addcooperlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('addcooperlist--');
    return Vue.http.post('/admin/system/user/V0_0_1/addUser', postdata).then(response => {
      stopLoading('addcooperlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 编辑协作账号
  coopereditlist({commit}, postdata) {
    console.log(postdata)
    beginLoading('coopereditlist--');
    return Vue.http.post('/admin/system/user/V0_0_1/updateUser', postdata).then(response => {
      stopLoading('coopereditlist--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 获取管理操作平台列表
  getOpretionList({commit}, postdata) {
    console.log(postdata)
    beginLoading('getOpretionList--');
    return Vue.http.post('/admin/log/redpaket/V0_0_1/RedpaketLogSearch', postdata).then(response => {
      stopLoading('getOpretionList--')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
}


















